﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Web;

/// <summary>
/// SearchShangPinBLL 的摘要说明
/// </summary>
public class SearchShangPinBLL
{
    /// <summary>
    /// 获取商品信息
    /// </summary>
    /// <param name="commodityName">商品名称</param>
    /// <param name="categoryName">商品类别</param>
    /// <returns></returns>
    public static DataSet SearchCommodityList(string commodityName, string categoryName)
    {
        string sql = "select * from ShangPin where 1=1";
        if (commodityName != "")
            sql += " and SPName like '%" + commodityName + "%' ";
        if (categoryName != "所有类别")
            sql += " and ShangPinFenLeiName like '%" + categoryName + "%' ";

        return CommonHelper.GetDataByAdapter(sql);
    }
}